﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;

namespace DAO
{
    public class BangCapRepository
    {
        public List<BangCapDTO> LayDanhSachBangCap()
        {
            List<BangCapDTO> list = new List<BangCapDTO>();
            try
            {
                QLTVEntities contex = new QLTVEntities();
                var query = from bangcap in contex.BANG_CAPList
                            select bangcap;
                foreach (var bangcapEF in query)
                {
                    BangCapDTO bangcapDTO = new BangCapDTO();
                    bangcapDTO.MaLoaiBangCap = bangcapEF.MaLoaiBangCap;
                    bangcapDTO.TenLoaiBangCap = bangcapEF.TenLoaiBangCap;
                    list.Add(bangcapDTO);
                }
            }
            catch(Exception )
            {
            }
            return list;
            
        }

    }
}
